﻿Namespace FTP
    ''' <summary>
    ''' Event arguments to facilitate the transfer complete event.
    ''' </summary>
    Public Class TransferCompleteEventArgs
        Inherits EventArgs

        Private _bytesTransferred As Long
        Private _bytesPerSecond As Integer
        Private _elapsedTime As TimeSpan

        ''' <summary>
        ''' Constructor.
        ''' </summary>
        ''' <param name="bytesTransferred">The total number of bytes transferred.</param>
        ''' <param name="bytesPerSecond">The data transfer speed in bytes per second.</param>
        ''' <param name="elapsedTime">The time that has elapsed since the data transfer started.</param>
        Public Sub New(ByVal bytesTransferred As Long, ByVal bytesPerSecond As Integer, ByVal elapsedTime As TimeSpan)
            _bytesTransferred = bytesTransferred
            _bytesPerSecond = bytesPerSecond
            _elapsedTime = elapsedTime
        End Sub

        ''' <summary>
        ''' The total number of bytes transferred.
        ''' </summary>
        Public ReadOnly Property BytesTransferred() As Long
            Get
                Return _bytesTransferred
            End Get
        End Property

        ''' <summary>
        ''' Gets the data transfer speed in bytes per second.
        ''' </summary>
        Public ReadOnly Property BytesPerSecond() As Integer
            Get
                Return _bytesPerSecond
            End Get
        End Property

        ''' <summary>
        ''' Gets the data transfer speed in kilobytes per second.
        ''' </summary>
        Public ReadOnly Property KilobytesPerSecond() As Integer
            Get
                Return _bytesPerSecond \ 1024
            End Get
        End Property

        ''' <summary>
        ''' Gets the time that has elapsed since the data transfer started.
        ''' </summary>
        Public ReadOnly Property ElapsedTime() As TimeSpan
            Get
                Return _elapsedTime
            End Get
        End Property


    End Class
End Namespace